module.exports = {
  payment(payRes) {
    var that = this;
    return new Promise((resolve, reject) => {
      const { timeStamp, nonceStr, signType, paySign } = payRes;
      uni.requestPayment({
        timeStamp,
        nonceStr,
        package: payRes.package,
        signType,
        paySign,
        success: (resp) => {
          uni.showToast({
            icon:'none',
            title:"支付成功"
          })
          resolve(resp)
        },
        fail: (error) => {
          reject(error)
          console.log('payment失败',error)
          // uni.showToast({
          //   icon: "none",
          //   title: "支付失败",
          // });
        },
      });
    });
  },
};
